﻿@{
    ViewBag.Title = "Home Page";
}

@*@model List<DemoShop.Models.Category>

<div class="row">
    <div class="panel panel-default">
        <h4>All category</h4>
    </div>
    <table class="table table-condensed">
        <thead>
            <tr>
                <th>Id</th>
                <th>Name</th>
                <th>Alias</th>
                <th>Content</th>
                <th>ParentId</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr>
                    <td>@item.Id</td>
                    <td>@item.Name</td>
                    <td>@item.Alias</td>
                    <td>@item.Content</td>
                    <td>@item.ParentId</td>
                </tr>
            }

        </tbody>
    </table>
</div>

<div class="row">
    <div class="panel panel-default">
        <h4>*Parent id:@ViewBag.parent.Id  name:@ViewBag.parent.Name</h4>
    </div>
    <table class="table table-condensed">
        <thead>
            <tr>
                <th>Id</th>
                <th>Name</th>
                <th>Alias</th>
                <th>Content</th>
                <th>ParentId</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in @ViewBag.parent.ListCategory)
            {
                <tr>
                    <td>@item.Id</td>
                    <td>@item.Name</td>
                    <td>@item.Alias</td>
                    <td>@item.Content</td>
                    <td>@item.ParentId</td>
                </tr>
            }

        </tbody>
    </table>
</div>

<div class="row">
    <div class="panel panel-default">
        <h4>All Parent</h4>
    </div>
    <table class="table table-condensed">
        <thead>
            <tr>
                <th>Id</th>
                <th>Name</th>
                <th>Chills</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in ViewBag.allParent)
            {
                <tr>
                    <td>@item.Id</td>
                    <td>@item.Name</td>
                    <td>
                        <select>
                            @foreach (var c in item.ListCategory)
                            {
                                <option value="@c.Id">@c.Name</option>
                            }
                        </select>
                    </td>
                </tr>
            }

        </tbody>
    </table>
</div>*@